﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" Title="Xtablish CRM / Edit Description Detail" AutoEventWireup="true" CodeBehind="EditDescriptionDetail.aspx.cs" Inherits="Web.Description_Details.EditDescriptionDetail" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="Con1" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function WebForm_OnSubmit() {
                if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
                    $("#validation_dialog").dialog({
                        title: "Validation Error!",
                        modal: true,
                        resizable: false,
                        buttons: {
                            Close: function () {
                                $(this).dialog('close');
                            }
                        }
                    });
                    return false;
                }
                return true;
            }
            function CancelClick() {
                window.location.assign(document.getElementById('<%= hdntxtPrevPage.ClientID %>').value);
            }
            function disableKeyPress(evt) {
                return false;
            }
            function isNumberKey(evt) {
                var charCode = (evt.which) ? evt.which : evt.keyCode
                if (charCode != 46)
                    if (charCode > 31 && (charCode < 48 || charCode > 57))
                        return false;
                return true;
            }
            function OnBlur(sender, args) {
                if (sender.get_value() == "") {
                    sender.set_value("0");
                }
            }
            function OnClientClose(oWnd, args) { }
        </script>
    </telerik:RadCodeBlock>
    <asp:HiddenField ID="hdntxtPrevPage" runat="server"></asp:HiddenField>
    <div class="register" id="divContent" runat="server" style="display: block">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-6">
                    <h3>Edit Description</h3>
                </div>
                <div class="col-md-6 btn-edit">
                    <asp:LinkButton id="btnTop_Delete" runat="server" class="btn btn-defaul" OnClick="btn_Delete_ServerClick"
                        OnClientClick="return radConfirmDelete(this, 'Are you sure you want to delete this Description ?');">
                        <img src="../Images/delete.png" style="width: 18px; height: 18px" />
                        Delete
                    </asp:LinkButton>
                    <asp:LinkButton id="btnTop_Save" type="button" runat="server" class="btn btn-defaul" OnClick="btn_Save_Click">
                        <img src="../Images/save.png" style="width: 18px; height: 18px" />
                        Save
                    </asp:LinkButton>
                    <div id="validation_dialog" style="display: none">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                    </div>
                    <asp:LinkButton id="btnTop_Cancel" type="button" runat="server" class="btn btn-defaul" OnClientClick="CancelClick()">
                        <img src="../Images/back.png" style="width: 18px; height: 18px" />
                        Back
                    </asp:LinkButton>

                </div>
            </div>
            <div class="row">
                <div class="edit-form highlight">
                    <div class="control-group">
                        <h4>Description</h4>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Description Name <span class="red-star">*</span></label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtDescriptionName" runat="server" class="form-control" data-validate="required" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="None" ControlToValidate="txtDescriptionName"
                                        runat="server" ErrorMessage="Discription Name is required."></asp:RequiredFieldValidator>
                                </div>
                            </div>
                        </div>

                        <div class="clearfix"></div>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Description </label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" class="form-control" Rows="2"></asp:TextBox>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <!-- end row 1 -->

            <div class="row">
                <div class="col-md-12 btn-edit">
                    <asp:LinkButton id="btnBottom_Delete" runat="server" class="btn btn-defaul" OnClick="btn_Delete_ServerClick"
                        OnClientClick="return radConfirmDelete(this, 'Are you sure you want to delete this Description ?');">
                        <img src="../Images/delete.png" style="width: 18px; height: 18px" />
                        Delete
                    </asp:LinkButton>
                    <asp:LinkButton id="btnBottom_Save" type="button" class="btn btn-defaul" runat="server" OnClick="btn_Save_Click">
                        <img src="../Images/save.png" style="width: 18px; height: 18px" />
                        Save
                    </asp:LinkButton>
                    <asp:LinkButton id="btnBottom_Cancel" runat="server" type="button" class="btn btn-defaul" OnClientClick="CancelClick()">
                        <img src="../Images/back.png" style="width: 18px; height: 18px" />
                        Back
                    </asp:LinkButton>
                </div>
            </div>
        </div>
    </div>
    <div class="register" id="divError" runat="server" style="display: none">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    Description is not exist, click <a href="DescriptionDetails.aspx"><strong>here</strong></a> to go back Description list.
                </div>
            </div>
        </div>
    </div>
</asp:Content>